//
//  QNKeybordFactory.h
//  CreditCat
//
//  Created by rsh on 20120/8/27.
//  Copyright © 2020年 rsh. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "QNNumberKeybordView.h"          //数字键盘
#import "QNIDPadView.h"                  //光标身份证键盘
#import "QNCursorNumberKeybordView.h"    //光标数字键盘



@interface QNKeybordFactory : NSObject


/**
 创建数字键盘(不需要管光标的情况下,且需要自己实现相应的代理)
 */
+ (QNNumberKeybordView *)fy_createNumberKeybordViewWithNumberPadType:(QNNumberPadType)numberPadType;


/**
 创建数字键盘(需要管光标的情况下,不需要自己实现相应的代理)，要主动show来展示键盘
 */
+ (QNCursorNumberKeybordView *)fy_createCursorNumberKeybordViewWithTargetTextfield:(UITextField *)targetTextfield numberPadType:(QNNumberPadType)numberPadType;


/**
 创建身份证键盘(光标需要控制,调用者不需要主动实现代理,只需要在textfield实现系统的代理就可以拿到输入框的内容)，要主动show来展示键盘
 */
+ (QNIDPadView *)fy_createIDKeybordViewWithTargetTextField:(UITextField *)targetTextField;


@end


/**
 *用法介绍：

 #import "QNKeybordFactory.h"
 
 
 
 //普通键盘
 QNNumberKeybordView *keybordView = [QNKeybordFactory qn_createNumberKeybordViewWithNumberPadType:randomNumberPadType];
 [self.view addSubview:keybordView];
 [keybordView mas_makeConstraints:^(MASConstraintMaker *make) {
 make.left.right.bottom.equalTo(@0);
 make.height.equalTo(@219);
 }];
 
 
 
 //自定义随机键盘
 @property (nonatomic, strong) QNCursorNumberKeybordView *keybordView;
 
 _keybordView = [QNKeybordFactory qn_createCursorNumberKeybordViewWithTargetTextfield:textField numberPadType:randomNumberPadType];
 [_keybordView inputTextCount:6]
 
 
 
 //身份证键盘
 @property (nonatomic, strong) QNIDPadView *keybordView;
 
 _keybordView = [QNKeybordFactory fy_createIDKeybordViewWithTargetTextField:textField];
 [_keybordView inputTextCount:18]

 
 
 
 //键盘展示消失
 // textField代理方法
 - (void)textFieldDidBeginEditing:(UITextField *)textField
 {
     if (textField == self.idCardNum.textField) {
         [self.keybordView show];
     }else{
         [self.keybordView dimiss];
     }
 }

 
 
 **/
